//
//	 ______    ______    ______    
//	/\  __ \  /\  ___\  /\  ___\   
//	\ \  __<  \ \  __\_ \ \  __\_ 
//	 \ \_____\ \ \_____\ \ \_____\ 
//	  \/_____/  \/_____/  \/_____/ 
//
//	Powered by BeeFramework
//
//
//  AddPetCell.m
//  DingDing
//
//  Created by LHL on 14/11/26.
//  Copyright (c) 2014年 com.gordon. All rights reserved.
//

#import "AddPetCell.h"

#pragma mark -

@implementation AddPetCell

SUPPORT_AUTOMATIC_LAYOUT( YES )
SUPPORT_RESOURCE_LOADING( YES )
DEF_OUTLET(BeeUIButton, female)
DEF_OUTLET(BeeUIButton, male)
DEF_OUTLET(BeeUIButton, petAge)
DEF_OUTLET(BeeUIButton, addPhoto)
DEF_OUTLET(BeeUIButton, petType)
DEF_OUTLET(BeeUIButton, confirm)
DEF_OUTLET(BeeUILabel, petTypeLabel)
DEF_OUTLET(BeeUILabel, petAgeLabel)
DEF_OUTLET(BeeUITextField, petName)
- (void)load
{
}

- (void)unload
{
}

- (void)dataDidChanged
{
        self.female.adjustsImageWhenHighlighted = NO;
        self.male.adjustsImageWhenHighlighted = NO;
}

- (void)layoutDidFinish
{
    // TODO: custom layout here
}

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    for (BeeUITextField *t  in self.subviews) {
        [t resignFirstResponder];
    }
}
ON_SIGNAL3( BeeUITextField, RETURN, signal ){
    UITextField *input = (UITextField *)signal.source;
    [input resignFirstResponder];
}

ON_SIGNAL3(BeeUIButton, male, SIGNAL){
    if (self.female.selected) {
        self.female.selected = NO;
    }
    self.male.selected = !self.male.selected;
}

ON_SIGNAL3(BeeUIButton, female, SIGNAL){
    if (self.male.selected) {
        self.male.selected = NO;
    }
    self.female.selected = !self.female.selected;
}

@end
